package com.groupbuying.storeinternal.controller.forManage;

import com.groupbuying.storeinternal.service.StoreMainInfoService;
import com.groupbuying.storeinternal.utils.R;
import com.groupbuying.storeinternal.utils.apiresult.ApiResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * @Author: wenguoqiang
 * @Email wguoqiango@163.com
 * @Date: 2019/11/5 0005 下午 3:00
 * @Des
 */
@Api("连锁子门店相关接口")
@RequestMapping("/storeMainInfo")
@RestController
public class StoreMainInfoController {


    @Autowired
    private StoreMainInfoService storeMainInfoService;

   /**
    * 查询通过优店门店列表
    * @author wenguoqiang
    * @date 下午 5:26 2019/11/27 0027
    * @des 详细描述
    * @tar 调用方(客户端小程序,服务商小程序,store后台,admin后台,api内部调用)
    */
    @ApiOperation(value = "查询通过优店门店列表", notes = "查询通过门店列表")
    @GetMapping("/getCrossUShopList")
    public R getCrossUShopList(@RequestParam Map<String, Object> params) {
        return storeMainInfoService.getCrossUShopList(params);
    }

    /**
     * @api {post} /storeMainInfo/getPaymentDayByCounterId  通过收银台id获取账期
     * @apiExample
     * author wenguoqiang
     * tar 调用方：
     * date 2020/1/9 0009 上午 9:59
     * @apiGroup
     * @apiVersion 1.0.0
     * @apiHeader {
     * @apiParam {String} null 无
     * @apiSuccess {Integer} code 请求结果 0-失败 1-成功
     * @apiSuccess {String} customerId 用户标示
     */
    @ApiOperation(value = "通过收银台id获取账期", notes = "通过收银台id获取账期")
    @GetMapping("/getPaymentDayByCounterId")
    public ApiResult getPaymentDayByCounterId(@RequestParam String counterId){
        return storeMainInfoService.getPaymentDayByCounterId(counterId);
    }


}
